<template>
<div class="Equ_table" >
  <div class="Equ_logo">
    <img src="https://gitee.com/xiao-ershi/img/raw/master/Equip_img%209.png" alt="">
    <p>设备管理</p>
  </div>
  <el-table
    :data="tableData"
    style="width: 100%">
    <el-table-column
      label="编号"
      align="center"
      >
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.id }}</span>
      </template>
    </el-table-column>

    <el-table-column
      label="设备名称"
      align="center"
      >
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.name }}</span>
      </template>
    </el-table-column>

    <el-table-column
      label="型号"
      align="center"
     >
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.model }}</span>
      </template>
    </el-table-column>

     <el-table-column
      label="总数"
      align="center"
     >
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.sum_num }}</span>
      </template>
    </el-table-column>

     <el-table-column
      label="已借"
      align="center"
     >
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.borrow }}</span>
      </template>
    </el-table-column>

      <el-table-column
      label="剩余"
      witb
     >
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.surplus }}</span>
      </template>
    </el-table-column>

    <el-table-column label="操作" width="300%">
      <template slot-scope="scope">
        <el-button
          size="mini"
          type="primary"
          @click="handleEdit(scope.$index, scope.row)">查看</el-button>
        <el-button
          size="mini"
          type="success"
          @click="handleDelete(scope.$index, scope.row)">导出</el-button>
            <el-button
          size="mini"
          type="danger"
          @click="handleDelete(scope.$index, scope.row)">删除</el-button>
      </template>
    </el-table-column>
    
  </el-table>
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage4"
      :page-sizes="[100, 200, 300, 400]"
      :page-size="100"
      layout="total, sizes, prev, pager, next, jumper"
      :total="400">
    </el-pagination>
  </div>
</template>

<script>
export default {
  data() {
      return {
      // 表单
         tableData: [{
          id:'1',
          date: '2016-05-02',
          name: '戴尔',
          model:'G3',
          sum_num: '20',
          borrow: '10',
          surplus: "20",
        },{
          id:'2',
          date: '2016-05-02',
          name: '戴尔',
          model:'G3',
          sum_num: '20',
          borrow: '10',
          surplus: "20",
        },{
          id:'3',
          date: '2016-05-02',
          name: '戴尔',
          model:'G3',
          sum_num: '20',
          borrow: '10',
          surplus: "20",
        }],
      };
    },
    methods: {
      // 表单
      handleEdit(index, row) {
        console.log(index, row);
      },
      handleDelete(index, row) {
        console.log(index, row);
      },

    }
}
</script>

<style scoped>
.Equ_table {
  position: relative;
  height: 100%;
  background-color: #fff;
} 
.el-button {
  display: inline-block;
}
.el-pagination {
  margin-top: 45%;
}
.Equ_logo {
  margin-top: 20px;
  margin-bottom: 10px;
  display: inline-block;
 
}
.Equ_logo p {
  padding-left: 20px;
  padding-top: 20px;
  font-weight: 600;
  font-size: 18px;
  float: right;
}
</style>